package com.danco.training.zaneuskaya.service.comparator;

import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;

import com.danco.training.zaneuskaya.domain.Book;

public class BookComparatorByReceiptDate implements Comparator<Book>,
		Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1743295803426390758L;

	public int compare(Book o1, Book o2) {

		Date d1 = o1.getReceiptDate();
		Date d2 = o2.getReceiptDate();

		return d1.compareTo(d2);
	}

}
